projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a04bf15
)
Fix integer overflow check in json code
author
Paul Eggert
<eggert@cs.ucla.edu>
Tue, 1 Jan 2019 07:07:33 +0000
(23:07 -0800)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Tue, 1 Jan 2019 07:35:55 +0000
(23:35 -0800)
* src/json.c (json_to_lisp): Check for ptrdiff_t overflow,
not fixnum overflow.
src/json.c
patch
|
blob
|
history
diff --git
a/src/json.c
b/src/json.c
index 46fb97a99e809dfce948c996f4b40f51ee7d6b7e..b5fb3fee05901bb546e39e5d8b4e427ab7c3cfe1 100644
(file)
--- a/
src/json.c
+++ b/
src/json.c
@@
-815,7
+815,7
@@
json_to_lisp (json_t *json, struct json_configuration *conf)
if (++lisp_eval_depth > max_lisp_eval_depth)
xsignal0 (Qjson_object_too_deep);
size_t size = json_array_size (json);
- if (
FIXNUM_OVERFLOW_P (size)
)
+ if (
PTRDIFF_MAX < size
)
overflow_error ();
Lisp_Object result = make_vector (size, Qunbound);
for (ptrdiff_t i = 0; i < size; ++i)